<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link rel="stylesheet" href="layui/css/layui.css">
    <script type="text/javascript" src="layui/layui.all.js"></script>

    <style type="text/css">
        .center{width: 486px; height: 514px; margin: 160px auto}
        input{width: 470px ;height: 50px; padding-left: 10px; margin-top: 45px}
        span{font-size: 12px;color: #999999}
        .sub{width: 482px;margin-top: 40px;}
       .span{width: 300px;height: 50px; font-size: 22px; color: #FF5722; position: absolute;margin-top: -520px; margin-left: 1165px;}
    </style>
    <script type="text/javascript" src="jquery-1.9.1.js"></script>
</head>
<body>
    <div class="center">
        <div class="tx1"><img src="imgs/hy.jpg" alt=""></div>
        <form method="post"  >
            <input type="text" placeholder="昵称" name="username" class="uname">
            <input type="password" placeholder="密码" name="password">
            <input type="text" placeholder="手机号码" name="pnumber">
            <span>可以通过手机号码找回密码</span>
            <input type="submit" value="立即注册" class="layui-btn layui-btn-normal sub">
        </form>

    </div>
    <div class="reg">
        <span class="span">账户已存在,请重新输入!</span>
    </div>


    <script type="text/javascript">

        $(".uname").blur(
            var vv = $(".uname").val();
            $.ajax({

                url: "myservlet",
                type: "POST",
                dataType: "json",
                data: {"username":vv}

            }).done(function (data) {
                console.log(data);
                if(data==1){
                    $(".span").hide();

                }
            })

        )

    </script>
</body>
</html>